function [error, rowDeleted] = deleteFilter(main, filterToDeleteID)

error = 1;  % If this doesn't change, no filter was deleted in this function
rowDeleted = 0; % Avoids "not assigned" error if no filter is deleted in this function

for index = 1 : main.filterAmount
    checkID = main.filterTracking{index,1};
    
    if checkID == filterToDeleteID
        delete(main.filterTracking{index,2});   % Deletes de property
        rowDeleted = index; % Returns wich row of filterTracking matched. Useful in rearrangeFilterTracking
        error = 0;      % Succeed
    end
    
end